export default {
	namespaced: true,
	state: {
		netWorkType: null,
		systemInfo: {}
	},
	mutations: {
		setNetWorkType(state, data) {
			state.netWorkType = String(data)
		},
		setSystemInfo(state, data) {
			state.systemInfo = data
		}
	},
	actions: {
		getSystemInfo({
			commit,
			state
		}) {
			if (state.systemInfo.brand) {
				return state.systemInfo
			}
			return uni.getSystemInfo().then(([err, data]) => {
				commit('setSystemInfo', data)
				return data
			})
		}
	}
}
